<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" href="/favicon.ico" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta
      name="apple-mobile-web-app-status-bar-style"
      content="black-translucent"
    />
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
    />
    <title>Vite App</title>
  </head>
  <body>
    <div id="app"></div>
    <script type="module" src="/src/main.js"></script>
    <script>
      // 检测用户访问页面时，滚动页面到顶部
      window.addEventListener("load", function () {
        setTimeout(function () {
          window.scrollTo(0, 1);
        }, 0);
      });

      // 监听页面滚动事件，当用户往下滚动时，再次滚动页面到顶部
      window.addEventListener("scroll", function () {
        if (document.body.scrollTop > 1) {
          window.scrollTo(0, 1);
        }
      });
    </script>
  </body>
</html>
